Class Memcache

Summary

Fully Qualified Name: Laminas\Cache\Storage\Adapter\Memcache
Extends: AbstractAdapter
Implements: AvailableSpaceCapableInterface, FlushableInterface, TotalSpaceCapableInterface

Description

Methods

Name Description Defined By
__construct() Constructor Memcache
__destruct() Destructor AbstractAdapter
addItem() Add an item. AbstractAdapter
addItems() Add multiple items. AbstractAdapter
addPlugin() Register a plugin AbstractAdapter
checkAndSetItem() Set an item only if token matches AbstractAdapter
decrementItem() Decrement an item. AbstractAdapter
decrementItems() Decrement multiple items. AbstractAdapter
flush() Flush the whole storage Memcache
getAvailableSpace() Get available space in bytes Memcache
getCaching() Get caching enabled. AbstractAdapter
getCapabilities() Get capabilities of this adapter AbstractAdapter
getEventManager() Get the event manager AbstractAdapter
getItem() Get an item. AbstractAdapter
getItems() Get multiple items. AbstractAdapter
getMetadata() Get metadata of an item. AbstractAdapter
getMetadatas() Get multiple metadata AbstractAdapter
getOptions() Get options. Memcache
getPluginRegistry() Return registry of plugins AbstractAdapter
getTotalSpace() Get total space in bytes Memcache
hasItem() Test if an item exists. AbstractAdapter
hasItems() Test multiple items. AbstractAdapter
hasPlugin() Check if a plugin is registered AbstractAdapter
incrementItem() Increment an item. AbstractAdapter
incrementItems() Increment multiple items. AbstractAdapter
removeItem() Remove an item. AbstractAdapter
removeItems() Remove multiple items. AbstractAdapter
removePlugin() Unregister an already registered plugin AbstractAdapter
replaceItem() Replace an existing item. AbstractAdapter
replaceItems() Replace multiple existing items. AbstractAdapter
setCaching() Enable/Disable caching. AbstractAdapter
setItem() Store an item. AbstractAdapter
setItems() Store multiple items. AbstractAdapter
setOptions() Set options. Memcache
touchItem() Reset lifetime of an item AbstractAdapter
touchItems() Reset lifetime of multiple items. AbstractAdapter

Method Details

__construct()

Constructor

Parameter Name Type Description
$options null|array|\Traversable|\MemcacheOptions

Returns:

__destruct()

Destructor

detach all registered plugins to free event handles of event manager

Returns: void

addItem()

Add an item.

Parameter Name Type Description
$key string
$value mixed

Returns: bool

addItems()

Add multiple items.

Parameter Name Type Description
$keyValuePairs array

Returns: array Array of not stored keys

addPlugin()

Register a plugin

Parameter Name Type Description
$plugin \Plugin\PluginInterface
$priority int

Returns: \AbstractAdapter Provides a fluent interface

checkAndSetItem()

Set an item only if token matches

It uses the token received from getItem() to check if the item has changed before overwriting it.

Parameter Name Type Description
$token mixed
$key string
$value mixed

Returns: bool

decrementItem()

Decrement an item.

Parameter Name Type Description
$key string
$value int

Returns: int|bool The new value on success, false on failure

decrementItems()

Decrement multiple items.

Parameter Name Type Description
$keyValuePairs array

Returns: array Associative array of keys and new values

flush()

Flush the whole storage

Returns: bool

getAvailableSpace()

Get available space in bytes

Returns: int|float

getCaching()

Get caching enabled.

Alias of getWritable and getReadable.

Returns: bool

getCapabilities()

Get capabilities of this adapter

Returns: \Capabilities

getEventManager()

Get the event manager

Returns: \EventManagerInterface

getItem()

Get an item.

Parameter Name Type Description
$key string
$success bool
$casToken mixed

Returns: mixed Data on success, null on failure

getItems()

Get multiple items.

Parameter Name Type Description
$keys array

Returns: array Associative array of keys and values

getMetadata()

Get metadata of an item.

Parameter Name Type Description
$key string

Returns: array|bool Metadata on success, false on failure

getMetadatas()

Get multiple metadata

Parameter Name Type Description
$keys array

Returns: array Associative array of keys and metadata

getOptions()

Get options.

Returns: \MemcacheOptions

getPluginRegistry()

Return registry of plugins

Returns: \SplObjectStorage

getTotalSpace()

Get total space in bytes

Returns: int|float

hasItem()

Test if an item exists.

Parameter Name Type Description
$key string

Returns: bool

hasItems()

Test multiple items.

Parameter Name Type Description
$keys array

Returns: array Array of found keys

hasPlugin()

Check if a plugin is registered

Parameter Name Type Description
$plugin \Plugin\PluginInterface

Returns: bool

incrementItem()

Increment an item.

Parameter Name Type Description
$key string
$value int

Returns: int|bool The new value on success, false on failure

incrementItems()

Increment multiple items.

Parameter Name Type Description
$keyValuePairs array

Returns: array Associative array of keys and new values

removeItem()

Remove an item.

Parameter Name Type Description
$key string

Returns: bool

removeItems()

Remove multiple items.

Parameter Name Type Description
$keys array

Returns: array Array of not removed keys

removePlugin()

Unregister an already registered plugin

Parameter Name Type Description
$plugin \Plugin\PluginInterface

Returns: \AbstractAdapter Provides a fluent interface

replaceItem()

Replace an existing item.

Parameter Name Type Description
$key string
$value mixed

Returns: bool

replaceItems()

Replace multiple existing items.

Parameter Name Type Description
$keyValuePairs array

Returns: array Array of not stored keys

setCaching()

Enable/Disable caching.

Alias of setWritable and setReadable.

Parameter Name Type Description
$flag bool

Returns: \AbstractAdapter Provides a fluent interface

setItem()

Store an item.

Parameter Name Type Description
$key string
$value mixed

Returns: bool

setItems()

Store multiple items.

Parameter Name Type Description
$keyValuePairs array

Returns: array Array of not stored keys

setOptions()

Set options.

Parameter Name Type Description
$options array|\Traversable|\MemcacheOptions

Returns: \Memcache

touchItem()

Reset lifetime of an item

Parameter Name Type Description
$key string

Returns: bool

touchItems()

Reset lifetime of multiple items.

Parameter Name Type Description
$keys array

Returns: array Array of not updated keys

Top